package com.vito.dcs.event.process.action;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.vito.base.authoriza.action.BaseAction;
import com.vito.base.model.Result;
import com.vito.dcs.event.process.service.EventProcessService;

@Controller
@RequestMapping("/dcs/event")
public class EventProcessAction extends BaseAction{
	
	private static final Logger log = LoggerFactory.getLogger(EventProcessAction.class);
	
	@Reference
	private EventProcessService eventProcessService;
	
	@RequestMapping("/saveProcessData")
	@ResponseBody
	public Result saveProcessData(@RequestParam Map<String,Object> map){
		Result res = new Result();
		try {
			eventProcessService.saveProcessData(map);
			res.setCode(Result.CODE_OK);
			res.setMsg("处理成功");
		} catch (Exception e) {
			log.error("处理失败", e);
			res.setCode(Result.CODE_ERROR);
			res.setMsg("处理失败");
		}
		return res;
	}
	
}

